﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Media3D;


namespace nl.tno.ict.multitouch.wpfmultitouch
{
    public class TouchedElement
    {
        public Visual Element;
        public Model3D ElementModel3D;
        public Visual3D ElementVisual3D;
        public DependencyObject DepObject;
        public double RelX;
        public double RelY;

        public TouchedElement(Visual element)
        {
            Element = element;
        }

        public TouchedElement(Model3D element)
        {
            ElementModel3D = element;
        }
        public TouchedElement(Visual3D element)
        {
            ElementVisual3D = element;
        }
        public TouchedElement(DependencyObject element)
        {
            DepObject = element;
        }

        public FrameworkElement FrameworkElement
        {
            get
            {
                if (Element is FrameworkElement) return (FrameworkElement)Element;
                return null;
            }
        }

        public override string ToString()
        {
            string result = Element.GetType().ToString();
            if (this.FrameworkElement != null && !string.IsNullOrEmpty(this.FrameworkElement.Name))
            {
                result += " (" + this.FrameworkElement.Name + ")";
            }
            return result;

        }

    }

    public class TouchedElementStack : List<TouchedElement> { }
}
